﻿using System;
using System.Drawing;
using System.Security.Cryptography.X509Certificates;
using Imgur.Net.Auth;

namespace Imgur.Net
{
    /// <summary>
    /// Interface defining the signature of operations backed by the Imgur "image" service. This consists primarily of CRUD operations related to a single image.
    /// </summary>
    public interface ImageProvider
    {
        /// <summary>
        /// Returns an ImageInfo describing the image identified by the <c>id</c> parameter.
        /// </summary>
        /// <param name="id">Imgur image ID</param>
        /// <returns>ImageInfo instance containing properties of the image.</returns>
        /// <seealso cref="ImageInfo"/>
        ImageInfo GetImageInfo(string id);

        /// <summary>
        /// Uploads the given image to Imgur service with the specified title and description ( if any ). This image
        /// will be a stand alone item and not be part of an album.
        /// </summary>
        /// <param name="image">The image to upload.</param>
        /// <param name="title">The title of the image.</param>
        /// <param name="description">A description of the image.</param>
        /// <returns>The image info pointing to the file uploaded.</returns>
        ImageInfo UploadImage(Image image, string title, string description);

        /// <summary>
        /// Uploads the given image to Imgur service with the specified title and description ( if any ). This image
        /// will added to the album specified by the albumId parameter.
        /// </summary>
        /// <param name="image">The image to upload.</param>
        /// <param name="title">The title of the image.</param>
        /// <param name="description">A description of the image.</param>
        /// <param name="albumId">The ID of the album to which this image should be added.</param>
        /// <returns>The image info pointing to the file uploaded.</returns>
        ImageInfo UploadImage(Image image, string title, string description, string albumId);

        /// <summary>
        /// Uploads the given image binary data to Imgur service with the specified title and description ( if any ). This image
        /// will be a stand alone item and not be part of an album.
        /// </summary>
        /// <param name="imageData">The image to upload.</param>
        /// <param name="title">The title of the image.</param>
        /// <param name="description">A description of the image.</param>
        /// <returns>The image info pointing to the file uploaded.</returns>
        ImageInfo UploadImage(byte[] imageData, string title, string description);

        /// <summary>
        /// Uploads the given image binary data to Imgur service with the specified title and description ( if any ). This image
        /// will added to the album specified by the albumId parameter.
        /// </summary>
        /// <param name="imageData">The image to upload.</param>
        /// <param name="title">The title of the image.</param>
        /// <param name="description">A description of the image.</param>
        /// <param name="albumId">The ID of the album to which this image should be added.</param>
        /// <returns>The image info pointing to the file uploaded.</returns>
        ImageInfo UploadImage(byte[] imageData, string title, string description, string albumId);

        /// <summary>
        /// Deleted the given Image ID from Imgur. For anonymous images the ID must be the deletehash of the image. For
        /// account owned images the simple Image ID is acceptable.
        /// </summary>
        /// <param name="id">ID of the image to delete. Deletehash for anonymouse images or ID for account owned images.</param>
        /// <returns>true if successful. false otherwise.</returns>
        bool? DeleteImage(string id);

        /// <summary>
        /// Updates the title and/or description of the given image. For anonymous images the id must be the deletehash of
        /// the image. For account owned images the Image ID is acceptable.
        /// </summary>
        /// <param name="id">ID of the image to update. Deletehash for anonymous images or ID for account owned images.</param>
        /// <param name="title">The new title for the image. Null to not update the title.</param>
        /// <param name="description">The new description for the image. Null to not update the image.</param>
        /// <returns>true if successful. False otherwise.</returns>
        bool? UpdateImageInfo(string id, string title, string description);

        /// <summary>
        /// Gets or sets the authentication provider used by this class for subsequent requests.
        /// </summary>
        ImgurAuthProvider AuthenticationProvider { get; set; }
    }
}
